/*
 * TItem.cpp
 *
 *  Created on: 2010-12-14
 *      Author: Xairy
 */

#include "TItem.h"

TItem* TItem::ConstructItem(TAny* p, EItemType aType, 
                            TUint16 aSize, const TAny* aObject)
{
    __ASSERT_DEBUG(p != NULL && aSize > 0 && aObject > 0, User::Invariant());
    TItem* result = new(p) TItem(aType);
    result->iSize = aSize;
    memcpy(result + 1, aObject, aSize);
    return result;
}

TBool TItem::Equal(const TItem& aItem) const
{
    if (this->Type() != aItem.Type() || 
        this->Size() != aItem.Size())
        return EFalse;
    return ETrue;
}
